package main

import (
	"fmt"
	"runtime"

	"sieve_engine/lib/app"
	"sieve_engine/lib/log"
	_ "sieve_engine/lib/log/filelog"
	"sieve_engine/manager"
)

func main() {
	app.Start()
	var (
		numCups = 10
		sysCups = runtime.NumCPU()
	)
	if numCups >= sysCups {
		numCups = sysCups / 2
	}
	log.Info(fmt.Sprintf("CPU核心数:%v", runtime.GOMAXPROCS(numCups)))
	go func() {
		manager.RunLoop()
	}()

	if err := NewWebServer(); err != nil {
		panic(err)
	}
}
